<template>
  <div id="app">
    <router-link to="/login" tag="button">登录页面</router-link>
    <router-link to="/home" tag="button">主页面</router-link>

    <button @click="pushShow()">push查看</button>
    <button @click="replaceShow()">replace查看</button>
    <Keep-alive :include="['My','home']">
      <router-view></router-view>
    </Keep-alive>
  </div>
</template>

<script>


export default {
  name: 'App',
  components: {

  },
  methods:{
      pushShow(){
        this.$router.push({
          name:'My',
          params:{
            id:'9',
            name:'小黄',
          },
        })
      },
      replaceShow(){
        this.$router.replace({
          name:'My',
          params:{
            id:'8',
            name:'小黑',
          },
        })
      },
  }
}
</script>

<style>

</style>
